On k-colored Lambda Terms and Their Skeletons
نویسنده
چکیده
The paper describes an application of logic programming to the modeling of difficult combinatorial properties of lambda terms, with focus on the class of simply typed terms. Lambda terms in de Bruijn notation are Motzkin trees (also called binary-unary trees) with indices at their leaves counting up on the path to the root the steps to their lambda binder. As a generalization of affine lambda terms, we introduce k-colored lambda terms obtained by labeling their lambda nodes with counts of the variables they bind. We define the skeleton of a k-colored lambda term as the Motzkin tree obtained by erasing the de Bruijn indices labeling its leaves. A new bijection between 2colored skeletons and binary trees reveals their connection to the Catalan family of combinatorial objects. After a statistical study of properties of k-colored lambda terms and their skeletons, we focus on the case of simply-typed closed k-colored lambda terms for which a new combinatorial generation algorithm is given and some interesting relations between maximal coloring, size of type expressions and typability are explored. The paper is structured as a literate Prolog program to facilitate an easily replicable, concise and declarative expression of our concepts and algorithms.
منابع مشابه
On lambda-term skeletons, with applications to all-term and random-term generation of simply-typed closed lambda terms
Lambda terms in de Bruijn notation are Motzkin trees (also called binary-unary trees) with indices at their leaves counting up to a binder among the lambdas on the path to the root labeling their leaves. Define the skeleton of a lambda term as the Motzkin tree obtained by erasing the de Bruijn indices labeling their leaves. Then, given a Motzkin tree, one can ask if it is the skeleton of at lea...
متن کاملOn Uniquely Closable and Uniquely Typable Skeletons of Lambda Terms
Uniquely closable skeletons of lambda terms are Motzkin-trees that predetermine the unique closed lambda term that can be obtained by labeling their leaves with de Bruijn indices. Likewise, uniquely typable skeletons of closed lambda terms predetermine the unique simply-typed lambda term that can be obtained by labeling their leaves with de Bruijn indices. We derive, through a sequence of logic...
متن کاملBounding Skeletons, Locally Scoped Terms and Exact Bounds for Linear Head Reduction
Bounding skeletons were recently introduced as a tool to study the length of interactions in Hyland/Ong game semantics. In this paper, we investigate the precise connection between them and execution of typed λ-terms. Our analysis sheds light on a new condition on λ-terms, called local scope. We show that the reduction of locally scoped terms matches closely that of bounding skeletons. Exploiti...
متن کاملHigher numerical ranges of matrix polynomials
Let $P(lambda)$ be an $n$-square complex matrix polynomial, and $1 leq k leq n$ be a positive integer. In this paper, some algebraic and geometrical properties of the $k$-numerical range of $P(lambda)$ are investigated. In particular, the relationship between the $k$-numerical range of $P(lambda)$ and the $k$-numerical range of its companion linearization is stated. Moreover, the $k$-numerical...
متن کاملمطالعهای بر رمزنگاری بصری و ارائهی روش پیشنهادی برای رمزنگاری تصاویر رنگی
Visual cryptography is a method that makes use of the characteristics of human vision and it requires neither the knowledge of cryptography nor the complex calculations. This method was first proposed by Naor and Shamir, its implementation is simple, it has been extended to an secrect sharing (k, n) in which n shares are made from the image and they are distributed among n participants. Moreov...
متن کامل